package com.reservoir.core.exception.base;

/**
 * 基础异常
 * 
 * @author ruoyi
 */
public class BaseException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    /**
     * 所属模块
     */
    private final String module;

    /**
     * 错误码
     */
    private final String code;

    /**
     * 错误消息
     */
    private final String defaultMessage;

    public BaseException(String module, String code, String defaultMessage)
    {
        this.module = module;
        this.code = code;
        this.defaultMessage = defaultMessage;
    }


    public BaseException(String module, String defaultMessage)
    {
        this(module, null, defaultMessage);
    }

    public BaseException(String defaultMessage)
    {
        this(null, null, defaultMessage);
    }

    public String getModule()
    {
        return module;
    }

    public String getCode()
    {
        return code;
    }

    public String getDefaultMessage()
    {
        return defaultMessage;
    }
}
